Skip to content

feat: honor alarms, recurrence, allDay, availability, url & timeZone in saveEvent/updateEvent - #2

Open
kukat wants to merge 2 commits into
Monitor-My-Solar:mainfrom
kukat:feat/save-event-full-details
Open

feat: honor alarms, recurrence, allDay, availability, url & timeZone in saveEvent/updateEvent#2
kukat wants to merge 2 commits into
Monitor-My-Solar:mainfrom
kukat:feat/save-event-full-details

Conversation

@kukat

@kukat kukat commented Jul 14, 2026

Copy link
Copy Markdown

Summary

saveEvent/updateEvent previously accepted only 6 flat scalar params (title, startDate, endDate, location, notes, calendarId), so alarms and every other rich field were silently dropped on iOS — even though the README documents alarm support and iOS already had a complete applyEventProperties: helper that simply wasn't being called. Android's native saveEvent already took a ReadableMap, so its signature didn't even match the flat TurboModule spec.

This changes saveEvent/updateEvent to take a single details object.

Changes

  • spec: saveEvent(details), updateEvent(eventId, details). details is typed as Object so codegen maps it to NSDictionary/ReadableMap (a structured type would emit a C++ struct that conflicts with the native impl and can't express the union/optional-heavy CalendarEvent shape — matching how e.g. react-native-netinfo passes dictionaries).
  • iOS: route both through the existing applyEventProperties:, which handles alarms (absolute date + relative minutes), recurrence, availability, allDay, url. Every field is guarded so a partial updateEvent() no longer clobbers untouched properties or reassigns an existing event to the default calendar. Adds timeZone for parity with Android.
  • Android: now matches the spec (was already ReadableMap-based); no logic change.
  • JS: forward the full CalendarEvent (Date → ISO strings) instead of 6 fields.

Compatibility

Public JS API (saveEvent(event: CalendarEvent)) is unchanged; the documented alarms/recurrence/availability/allDay/url fields now actually take effect.

🤖 Generated with Claude Code

twcyao and others added 2 commits July 14, 2026 17:06
…in saveEvent/updateEvent

saveEvent/updateEvent previously accepted only 6 flat scalar params (title,
startDate, endDate, location, notes, calendarId), so alarms and every other rich
field were silently dropped on iOS — even though the README documents alarm
support and iOS already had a complete `applyEventProperties:` helper (it just
wasn't called). Android's native saveEvent already took a ReadableMap, so its
signature didn't even match the flat TurboModule spec.

Change saveEvent/updateEvent to take a single `details` object (typed as `Object`
in the spec -> NSDictionary / ReadableMap, matching how e.g. react-native-netinfo
passes dictionaries and avoiding a codegen C++ struct that conflicts with the
native impl):

- spec: saveEvent(details), updateEvent(eventId, details)
- iOS: route both through the existing applyEventProperties:, which handles
  alarms (absolute date + relative minutes), recurrence, availability, allDay,
  url. Guard every field so a partial updateEvent() no longer clobbers untouched
  properties or reassigns an existing event to the default calendar. Add timeZone
  for parity with Android.
- Android: now matches the spec (was already ReadableMap-based); no logic change.
- JS: forward the full CalendarEvent (Date -> ISO strings) instead of 6 fields.

Public JS API (saveEvent(event: CalendarEvent)) is unchanged; the documented
alarms/recurrence/availability/allDay/url fields now actually take effect.
The Android module was broken under the new architecture in three ways,
so getEnforcing('RNCalendarEventsNativeSpec') failed at runtime while iOS
worked:

- NAME was "CalendarEventsNative" but the JS spec and iOS
  RCT_EXPORT_MODULE both use "RNCalendarEventsNativeSpec" -> module not
  found. Align NAME (drives @ReactModule, getName(), and the
  ReactModuleInfo/getModule registration).
- The module did not implement TurboModule, so
  ReactPackageTurboModuleManagerDelegate.getModule() returned null
  ("Unable to create module ... turbo: true"). Add the marker interface.
- findOrCreateCalendar(ReadableMap) did not match the codegen signature
  findOrCreateCalendar(String, String, String, String) the C++ layer
  invokes reflectively, and debugModuleMethods was missing. Correct the
  signature and add the method.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants